Optimal. Leaf size=137 \[ \frac {a^3 \log (\cos (c+d x))}{d}-\frac {3 a^3 \sec (c+d x)}{d}+\frac {8 a^3 \sec ^3(c+d x)}{3 d}+\frac {3 a^3 \sec ^4(c+d x)}{2 d}-\frac {6 a^3 \sec ^5(c+d x)}{5 d}-\frac {4 a^3 \sec ^6(c+d x)}{3 d}+\frac {3 a^3 \sec ^8(c+d x)}{8 d}+\frac {a^3 \sec ^9(c+d x)}{9 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 137, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3964, 90}
\begin {gather*} \frac {a^3 \sec ^9(c+d x)}{9 d}+\frac {3 a^3 \sec ^8(c+d x)}{8 d}-\frac {4 a^3 \sec ^6(c+d x)}{3 d}-\frac {6 a^3 \sec ^5(c+d x)}{5 d}+\frac {3 a^3 \sec ^4(c+d x)}{2 d}+\frac {8 a^3 \sec ^3(c+d x)}{3 d}-\frac {3 a^3 \sec (c+d x)}{d}+\frac {a^3 \log (\cos (c+d x))}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 90
Rule 3964
Rubi steps
\begin {align*} \int (a+a \sec (c+d x))^3 \tan ^7(c+d x) \, dx &=-\frac {\text {Subst}\left (\int \frac {(a-a x)^3 (a+a x)^6}{x^{10}} \, dx,x,\cos (c+d x)\right )}{a^6 d}\\ &=-\frac {\text {Subst}\left (\int \left (\frac {a^9}{x^{10}}+\frac {3 a^9}{x^9}-\frac {8 a^9}{x^7}-\frac {6 a^9}{x^6}+\frac {6 a^9}{x^5}+\frac {8 a^9}{x^4}-\frac {3 a^9}{x^2}-\frac {a^9}{x}\right ) \, dx,x,\cos (c+d x)\right )}{a^6 d}\\ &=\frac {a^3 \log (\cos (c+d x))}{d}-\frac {3 a^3 \sec (c+d x)}{d}+\frac {8 a^3 \sec ^3(c+d x)}{3 d}+\frac {3 a^3 \sec ^4(c+d x)}{2 d}-\frac {6 a^3 \sec ^5(c+d x)}{5 d}-\frac {4 a^3 \sec ^6(c+d x)}{3 d}+\frac {3 a^3 \sec ^8(c+d x)}{8 d}+\frac {a^3 \sec ^9(c+d x)}{9 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.38, size = 110, normalized size = 0.80 \begin {gather*} \frac {a^3 (1+\cos (c+d x))^3 \sec ^6\left (\frac {1}{2} (c+d x)\right ) \left (360 \log (\cos (c+d x))-1080 \sec (c+d x)+960 \sec ^3(c+d x)+540 \sec ^4(c+d x)-432 \sec ^5(c+d x)-480 \sec ^6(c+d x)+135 \sec ^8(c+d x)+40 \sec ^9(c+d x)\right )}{2880 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(317\) vs.
\(2(125)=250\).
time = 0.15, size = 318, normalized size = 2.32
method | result | size |
risch | \(-i a^{3} x -\frac {2 i a^{3} c}{d}-\frac {2 a^{3} \left (135 \,{\mathrm e}^{17 i \left (d x +c \right )}+600 \,{\mathrm e}^{15 i \left (d x +c \right )}-540 \,{\mathrm e}^{14 i \left (d x +c \right )}+1764 \,{\mathrm e}^{13 i \left (d x +c \right )}-780 \,{\mathrm e}^{12 i \left (d x +c \right )}+3816 \,{\mathrm e}^{11 i \left (d x +c \right )}-1800 \,{\mathrm e}^{10 i \left (d x +c \right )}+3754 \,{\mathrm e}^{9 i \left (d x +c \right )}-1800 \,{\mathrm e}^{8 i \left (d x +c \right )}+3816 \,{\mathrm e}^{7 i \left (d x +c \right )}-780 \,{\mathrm e}^{6 i \left (d x +c \right )}+1764 \,{\mathrm e}^{5 i \left (d x +c \right )}-540 \,{\mathrm e}^{4 i \left (d x +c \right )}+600 \,{\mathrm e}^{3 i \left (d x +c \right )}+135 \,{\mathrm e}^{i \left (d x +c \right )}\right )}{45 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{9}}+\frac {a^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) | \(225\) |
derivativedivides | \(\frac {a^{3} \left (\frac {\sin ^{8}\left (d x +c \right )}{9 \cos \left (d x +c \right )^{9}}+\frac {\sin ^{8}\left (d x +c \right )}{63 \cos \left (d x +c \right )^{7}}-\frac {\sin ^{8}\left (d x +c \right )}{315 \cos \left (d x +c \right )^{5}}+\frac {\sin ^{8}\left (d x +c \right )}{315 \cos \left (d x +c \right )^{3}}-\frac {\sin ^{8}\left (d x +c \right )}{63 \cos \left (d x +c \right )}-\frac {\left (\frac {16}{5}+\sin ^{6}\left (d x +c \right )+\frac {6 \left (\sin ^{4}\left (d x +c \right )\right )}{5}+\frac {8 \left (\sin ^{2}\left (d x +c \right )\right )}{5}\right ) \cos \left (d x +c \right )}{63}\right )+\frac {3 a^{3} \left (\sin ^{8}\left (d x +c \right )\right )}{8 \cos \left (d x +c \right )^{8}}+3 a^{3} \left (\frac {\sin ^{8}\left (d x +c \right )}{7 \cos \left (d x +c \right )^{7}}-\frac {\sin ^{8}\left (d x +c \right )}{35 \cos \left (d x +c \right )^{5}}+\frac {\sin ^{8}\left (d x +c \right )}{35 \cos \left (d x +c \right )^{3}}-\frac {\sin ^{8}\left (d x +c \right )}{7 \cos \left (d x +c \right )}-\frac {\left (\frac {16}{5}+\sin ^{6}\left (d x +c \right )+\frac {6 \left (\sin ^{4}\left (d x +c \right )\right )}{5}+\frac {8 \left (\sin ^{2}\left (d x +c \right )\right )}{5}\right ) \cos \left (d x +c \right )}{7}\right )+a^{3} \left (\frac {\left (\tan ^{6}\left (d x +c \right )\right )}{6}-\frac {\left (\tan ^{4}\left (d x +c \right )\right )}{4}+\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}+\ln \left (\cos \left (d x +c \right )\right )\right )}{d}\) | \(318\) |
default | \(\frac {a^{3} \left (\frac {\sin ^{8}\left (d x +c \right )}{9 \cos \left (d x +c \right )^{9}}+\frac {\sin ^{8}\left (d x +c \right )}{63 \cos \left (d x +c \right )^{7}}-\frac {\sin ^{8}\left (d x +c \right )}{315 \cos \left (d x +c \right )^{5}}+\frac {\sin ^{8}\left (d x +c \right )}{315 \cos \left (d x +c \right )^{3}}-\frac {\sin ^{8}\left (d x +c \right )}{63 \cos \left (d x +c \right )}-\frac {\left (\frac {16}{5}+\sin ^{6}\left (d x +c \right )+\frac {6 \left (\sin ^{4}\left (d x +c \right )\right )}{5}+\frac {8 \left (\sin ^{2}\left (d x +c \right )\right )}{5}\right ) \cos \left (d x +c \right )}{63}\right )+\frac {3 a^{3} \left (\sin ^{8}\left (d x +c \right )\right )}{8 \cos \left (d x +c \right )^{8}}+3 a^{3} \left (\frac {\sin ^{8}\left (d x +c \right )}{7 \cos \left (d x +c \right )^{7}}-\frac {\sin ^{8}\left (d x +c \right )}{35 \cos \left (d x +c \right )^{5}}+\frac {\sin ^{8}\left (d x +c \right )}{35 \cos \left (d x +c \right )^{3}}-\frac {\sin ^{8}\left (d x +c \right )}{7 \cos \left (d x +c \right )}-\frac {\left (\frac {16}{5}+\sin ^{6}\left (d x +c \right )+\frac {6 \left (\sin ^{4}\left (d x +c \right )\right )}{5}+\frac {8 \left (\sin ^{2}\left (d x +c \right )\right )}{5}\right ) \cos \left (d x +c \right )}{7}\right )+a^{3} \left (\frac {\left (\tan ^{6}\left (d x +c \right )\right )}{6}-\frac {\left (\tan ^{4}\left (d x +c \right )\right )}{4}+\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}+\ln \left (\cos \left (d x +c \right )\right )\right )}{d}\) | \(318\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 110, normalized size = 0.80 \begin {gather*} \frac {360 \, a^{3} \log \left (\cos \left (d x + c\right )\right ) - \frac {1080 \, a^{3} \cos \left (d x + c\right )^{8} - 960 \, a^{3} \cos \left (d x + c\right )^{6} - 540 \, a^{3} \cos \left (d x + c\right )^{5} + 432 \, a^{3} \cos \left (d x + c\right )^{4} + 480 \, a^{3} \cos \left (d x + c\right )^{3} - 135 \, a^{3} \cos \left (d x + c\right ) - 40 \, a^{3}}{\cos \left (d x + c\right )^{9}}}{360 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.27, size = 117, normalized size = 0.85 \begin {gather*} \frac {360 \, a^{3} \cos \left (d x + c\right )^{9} \log \left (-\cos \left (d x + c\right )\right ) - 1080 \, a^{3} \cos \left (d x + c\right )^{8} + 960 \, a^{3} \cos \left (d x + c\right )^{6} + 540 \, a^{3} \cos \left (d x + c\right )^{5} - 432 \, a^{3} \cos \left (d x + c\right )^{4} - 480 \, a^{3} \cos \left (d x + c\right )^{3} + 135 \, a^{3} \cos \left (d x + c\right ) + 40 \, a^{3}}{360 \, d \cos \left (d x + c\right )^{9}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 350 vs.
\(2 (126) = 252\).
time = 2.40, size = 350, normalized size = 2.55 \begin {gather*} \begin {cases} - \frac {a^{3} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {a^{3} \tan ^{6}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}}{9 d} + \frac {3 a^{3} \tan ^{6}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{8 d} + \frac {3 a^{3} \tan ^{6}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{7 d} + \frac {a^{3} \tan ^{6}{\left (c + d x \right )}}{6 d} - \frac {2 a^{3} \tan ^{4}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}}{21 d} - \frac {3 a^{3} \tan ^{4}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{8 d} - \frac {18 a^{3} \tan ^{4}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{35 d} - \frac {a^{3} \tan ^{4}{\left (c + d x \right )}}{4 d} + \frac {8 a^{3} \tan ^{2}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}}{105 d} + \frac {3 a^{3} \tan ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{8 d} + \frac {24 a^{3} \tan ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{35 d} + \frac {a^{3} \tan ^{2}{\left (c + d x \right )}}{2 d} - \frac {16 a^{3} \sec ^{3}{\left (c + d x \right )}}{315 d} - \frac {3 a^{3} \sec ^{2}{\left (c + d x \right )}}{8 d} - \frac {48 a^{3} \sec {\left (c + d x \right )}}{35 d} & \text {for}\: d \neq 0 \\x \left (a \sec {\left (c \right )} + a\right )^{3} \tan ^{7}{\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 317 vs.
\(2 (125) = 250\).
time = 3.97, size = 317, normalized size = 2.31 \begin {gather*} -\frac {2520 \, a^{3} \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1 \right |}\right ) - 2520 \, a^{3} \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1 \right |}\right ) + \frac {14297 \, a^{3} + \frac {133713 \, a^{3} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {560052 \, a^{3} {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {1384068 \, a^{3} {\left (\cos \left (d x + c\right ) - 1\right )}^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {1594782 \, a^{3} {\left (\cos \left (d x + c\right ) - 1\right )}^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {1336734 \, a^{3} {\left (\cos \left (d x + c\right ) - 1\right )}^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} + \frac {781956 \, a^{3} {\left (\cos \left (d x + c\right ) - 1\right )}^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}} + \frac {302004 \, a^{3} {\left (\cos \left (d x + c\right ) - 1\right )}^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}} + \frac {69201 \, a^{3} {\left (\cos \left (d x + c\right ) - 1\right )}^{8}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{8}} + \frac {7129 \, a^{3} {\left (\cos \left (d x + c\right ) - 1\right )}^{9}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{9}}}{{\left (\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1\right )}^{9}}}{2520 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.17, size = 278, normalized size = 2.03 \begin {gather*} \frac {2\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{16}-18\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{14}+\frac {218\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}}{3}-174\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+\frac {1382\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8}{5}-\frac {1558\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6}{5}+\frac {602\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{5}-\frac {138\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{5}+\frac {128\,a^3}{45}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{18}-9\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{16}+36\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{14}-84\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}+126\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}-126\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+84\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-36\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+9\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )}-\frac {2\,a^3\,\mathrm {atanh}\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________